package com.mql.gre.business;

import java.util.List;

import com.mql.gre.beans.Document;
import com.mql.gre.dao.DAO;
import com.mql.gre.dao.XMLDAO;

public class DocumentManagerImpl implements DocumentManager {

	private DAO dao;

	public DocumentManagerImpl() {
		dao = new XMLDAO();
	}

	public void addDocument(Document document) {
		dao.insert(document);

	}

	public void updateDocument(Document document) {
		dao.update(document);

	}

	public Document getDocumentByID(String id) {

		return dao.select(id);
	}

	public void deleteDocument(Document document) {

		dao.remove(document);
	}

	public void deleteDocument(String id) {

		dao.remove(id);
	}

	public List<Document> getDocuments(Criterias criterias) {

		return dao.select(criterias);
	}

}
